<?php
/**
 * Created by PhpStorm.
 * User: lyw
 * Date: 2016/5/20
 * Time: 10:52
 */

class Message_send_recordController extends BaseController {

    function index(){
        $doMessageSend = new Do消息发送记录();
        $messageId = $this->request('messageId');
        $sendStatus = $this->request('send_status');
        $name = $this->request('name');
        $data = [];

        if ($messageId) {
            $data[] = "信息id='".$messageId."'";
        }
        if($sendStatus){
            $data[] = "是否正确发送='".$sendStatus."'";
        }
        if($name){
            $data[] = "name ='".$name."'";
        }
        $where = implode(' and ',$data);
        $count = $doMessageSend->where($where)->count();

        $page = new \tools\Page($count,15);
        $doMessageSend = new Do消息发送记录();
        $messageRecords =  $doMessageSend->where($where)
            ->offset($page->limit)->limit($page->pagesize)->orderby("发送时间 desc")->rows();
        require $this->template;
    }

}